// pages/home/index/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    navNum:0,
    shopLiset:0,
    shoplist:[{id:1,name:'煌华新纪元1'},{id:2,name:'煌华新纪元2'},{id:3,name:'煌华新纪元3'},{id:4,name:'煌华新纪元4'},{id:5,name:'煌华新纪元5'},{id:6,name:'煌华新纪元6'},{id:7,name:'煌华新纪元7'},{id:8,name:'煌华新纪元8'}],
    shopName:'',
    num:''
  },

  /**
   * 组件的方法列表
   */
  methods: {
    navBtn:function(e){
      //console.log(e.currentTarget.dataset.navnum)
      this.setData({
        navNum:e.currentTarget.dataset.navnum
      })
    },
    shoplistBtn:function(){
      this.setData({
        shopLiset:1
      })
    },
    shopLiset:function(){
      this.setData({
        shopLiset:0
      })
    },
    listBtn:function(e){
      console.log(e)
      console.log(e.currentTarget.dataset.id)
      console.log(this.data.shopName)
      var list=this.data.shoplist
      for (var i=0;i<list.length;i++){
        if(e.currentTarget.dataset.id==list[i].id){
          list=list[i].name
        }
      }
      this.setData({
        shopLiset:0,
        shopName:list
      })
    }
  }
})
